const mongoose=require("mongoose");
//登录
module.exports={login3,getadmin3,addadmin3,changeadmin3,adminone3,changestate3};
async function login3(loginData){
    const result=await mongoose.model('adminsModel').find(loginData);
    return result;

}
//获取用户列表
async function getadmin3(data){
    const result =await mongoose.model('adminsModel').find();
    return result;
}
//新增用户
async function addadmin3(data){
    const result =await mongoose.model('adminsModel').create(data);
    return result;
}
//找到修改数据
async function adminone3(data){
    const result =await mongoose.model('adminsModel').find(data);
    return result;
}
//修改用户状态
async function changestate3({_id,loginState}){
    const result =await mongoose.model('adminsModel').updateOne({_id},{loginState});
    return result;
}
//修改用户信息
async function changeadmin3({_id,loginState,userName,passWord,phone}){
    const result =await mongoose.model('adminsModel').updateOne({_id},{loginState,userName,passWord,phone});
    return result;
}